package com.cq.hd.member.po;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
import com.cq.hd.member.handler.JsonLongListTypeHandler;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 商家积分商城产品
 * </p>
 *
 * @author mYunYu
 * @since 2023-11-21
 */
@Data
@EqualsAndHashCode(callSuper = false)
@Accessors(chain = true)
@TableName(value = "tb_business_points_mall_product", autoResultMap = true)
@ApiModel(value = "TbBusinessPointsMallProductPo对象", description = "商家积分商城产品")
public class TbBusinessPointsMallProductPo implements Serializable {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "自增id")
    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "商家id")
    @TableField("business_id")
    private Long businessId;

    @ApiModelProperty(value = "产品类型：1优惠券 2核销商品")
    @TableField("product_type")
    private Integer productType;

    @ApiModelProperty(value = "优惠金额")
    @TableField("amount")
    private BigDecimal amount;

    @ApiModelProperty(value = "上架数量")
    @TableField("total_num")
    private Integer totalNum;

    @ApiModelProperty(value = "兑换数量")
    @TableField("used_num")
    private Integer usedNum;

    @ApiModelProperty(value = "剩余数量")
    @TableField("remain_num")
    private Integer remainNum;

    @ApiModelProperty(value = "使用期限，x天")
    @TableField("day_limit")
    private Integer dayLimit;

    @ApiModelProperty(value = "兑换需x积分")
    @TableField("required_points")
    private BigDecimal requiredPoints;

    @ApiModelProperty(value = "生效时间")
    @TableField("effective_time")
    private LocalDateTime effectiveTime;

    @ApiModelProperty(value = "满x元可用，0表示无门槛[优惠券]")
    @TableField("full_amount")
    private BigDecimal fullAmount;

    @ApiModelProperty(value = "商品名称[核销商品]")
    private String goodsName;

    @ApiModelProperty(value = "商品图片[核销商品]")
    @TableField(typeHandler = JacksonTypeHandler.class)
    private List<String> goodsImages;

    @ApiModelProperty(value = "适用商户id[核销商品]")
    @TableField(typeHandler = JsonLongListTypeHandler.class)
    private List<Long> merchantIds;

    @ApiModelProperty(value = "商品详情[核销商品]")
    private String details;

    @ApiModelProperty(value = "创建时间")
    @TableField("create_time")
    private LocalDateTime createTime;

    @ApiModelProperty(value = "更新时间")
    @TableField("update_time")
    private LocalDateTime updateTime;

    @ApiModelProperty(value = "删除状态:0-正常，1-已删除")
    @TableField("del_state")
    private Integer delState;
}
